package com.example.penggo;

import java.util.HashMap;
import java.util.Map;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.util.Log;
import android.widget.Button;
import android.widget.Toast; 
import android.view.KeyEvent;
import android.view.View.OnClickListener;
import android.view.View;


import com.parse.FunctionCallback;
import com.parse.ParseCloud;
import com.parse.ParseException;

public class CloudTestActivity extends Activity {  
    private final static String TAG="CloudTestActivity";  
    @Override  
    protected void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        Log.v(TAG, "onCreate");  
        setContentView(R.layout.activity_cloudtest);  

        Button btnExit=(Button)findViewById(R.id.test);  

        btnExit.setOnClickListener(new OnClickListener() {  
            @Override  
            public void onClick(View v) {  
//                finish();
            	Map map = new HashMap();
                ParseCloud.callFunctionInBackground("hello", map, new FunctionCallback<String>() {
             	   public void done(String result, ParseException e) {
             	       if (e == null) {
             	    	  Toast.makeText(CloudTestActivity.this, result, Toast.LENGTH_SHORT).show();           
             	       }
             	   }
             	});           	
       	
            }  
        }); 
        
        
        

   	
    }  
    

    @Override  
    protected void onStart() {  
        super.onStart();  
        Log.v(TAG, "onStart");  
    }  
    @Override  
    protected void onResume() {  
        super.onResume();  
        Log.v(TAG, "onResume");  
    }  
    @Override  
    protected void onPause() {  
        super.onPause();  
        Log.v(TAG, "onPause");  
    }  
    @Override  
    protected void onStop() {  
        super.onStop();  
        Log.v(TAG, "onStop");  
    }  
    @Override  
    protected void onDestroy() {  
        super.onDestroy();  
        Log.v(TAG, "onDestroy");  
    }  
      
} 